const _base: string = '/bzgj'
export const imageApis: string = '/imageApis'
export const download:string='bzgjDownload'
export const baseApp: string = '/app'
// const _base = process.env.NODE_ENV === 'production' ? "/apis" : "http://suzamdsltlab002:8090";
export const baseApi: string = _base

/**
 * 平台、设备和操作系统 ，返回true或false,true表示是移动端，false表示不是移动端
 */
function _isMobile(): boolean {
  var mobileArray: Array<string> = [
    'iPhone',
    'iPad',
    'Android',
    'Windows Phone',
    'BB10; Touch',
    'BB10; Touch',
    'PlayBook',
    'Nokia'
  ]
  var ua: string = navigator.userAgent
  return (
    mobileArray.findIndex(key => {
      return ua.indexOf(key) > 0
    }) >= 0
  )
}

export const isMobile: boolean = _isMobile()
/**
 * 根据不同的平台设置不同的token
 */
export const tokenName: string = _isMobile()
  ? 'APP_annotates'
  : 'PC_annotates'

export const skinNameKey: string = 'PC_annotates_skin'

/**
 * 放行请求路径
 */
export const excludesRequestPath: Array<string> = [
  `${_base}/user/login`,
  `${_base}/user/register`
]


/**
 * 放行Router路径
 */
export const excludesRouterName: Array<string> = [`login`, `register`, '404','redirected']

export type RequestCode = {
  code: number
  data: any
  msg: String
}
